package com.projManage.service.model;

import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;


public class projManagedbClp extends BaseModelImpl<projManagedb>
    implements projManagedb {
    private long _id;
    private String _username;
    private String _password;
    private String _dpurl;
    private boolean _login;
    private String _loginuser;

    public projManagedbClp() {
    }

    public long getPrimaryKey() {
        return _id;
    }

    public void setPrimaryKey(long pk) {
        setId(pk);
    }

    public Serializable getPrimaryKeyObj() {
        return new Long(_id);
    }

    public long getId() {
        return _id;
    }

    public void setId(long id) {
        _id = id;
    }

    public String getUsername() {
        return _username;
    }

    public void setUsername(String username) {
        _username = username;
    }

    public String getPassword() {
        return _password;
    }

    public void setPassword(String password) {
        _password = password;
    }

    public String getDpurl() {
        return _dpurl;
    }

    public void setDpurl(String dpurl) {
        _dpurl = dpurl;
    }

    public boolean getLogin() {
        return _login;
    }

    public boolean isLogin() {
        return _login;
    }

    public void setLogin(boolean login) {
        _login = login;
    }

    public String getLoginuser() {
        return _loginuser;
    }

    public void setLoginuser(String loginuser) {
        _loginuser = loginuser;
    }

    public projManagedb toEscapedModel() {
        if (isEscapedModel()) {
            return this;
        } else {
            projManagedb model = new projManagedbClp();

            model.setEscapedModel(true);

            model.setId(getId());
            model.setUsername(HtmlUtil.escape(getUsername()));
            model.setPassword(HtmlUtil.escape(getPassword()));
            model.setDpurl(HtmlUtil.escape(getDpurl()));
            model.setLogin(getLogin());
            model.setLoginuser(HtmlUtil.escape(getLoginuser()));

            model = (projManagedb) Proxy.newProxyInstance(projManagedb.class.getClassLoader(),
                    new Class[] { projManagedb.class },
                    new ReadOnlyBeanHandler(model));

            return model;
        }
    }

    public Object clone() {
        projManagedbClp clone = new projManagedbClp();

        clone.setId(getId());
        clone.setUsername(getUsername());
        clone.setPassword(getPassword());
        clone.setDpurl(getDpurl());
        clone.setLogin(getLogin());
        clone.setLoginuser(getLoginuser());

        return clone;
    }

    public int compareTo(projManagedb projManagedb) {
        long pk = projManagedb.getPrimaryKey();

        if (getPrimaryKey() < pk) {
            return -1;
        } else if (getPrimaryKey() > pk) {
            return 1;
        } else {
            return 0;
        }
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        projManagedbClp projManagedb = null;

        try {
            projManagedb = (projManagedbClp) obj;
        } catch (ClassCastException cce) {
            return false;
        }

        long pk = projManagedb.getPrimaryKey();

        if (getPrimaryKey() == pk) {
            return true;
        } else {
            return false;
        }
    }

    public int hashCode() {
        return (int) getPrimaryKey();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append("{id=");
        sb.append(getId());
        sb.append(", username=");
        sb.append(getUsername());
        sb.append(", password=");
        sb.append(getPassword());
        sb.append(", dpurl=");
        sb.append(getDpurl());
        sb.append(", login=");
        sb.append(getLogin());
        sb.append(", loginuser=");
        sb.append(getLoginuser());
        sb.append("}");

        return sb.toString();
    }

    public String toXmlString() {
        StringBuilder sb = new StringBuilder();

        sb.append("<model><model-name>");
        sb.append("com.projManage.service.model.projManagedb");
        sb.append("</model-name>");

        sb.append(
            "<column><column-name>id</column-name><column-value><![CDATA[");
        sb.append(getId());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>username</column-name><column-value><![CDATA[");
        sb.append(getUsername());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>password</column-name><column-value><![CDATA[");
        sb.append(getPassword());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>dpurl</column-name><column-value><![CDATA[");
        sb.append(getDpurl());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>login</column-name><column-value><![CDATA[");
        sb.append(getLogin());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>loginuser</column-name><column-value><![CDATA[");
        sb.append(getLoginuser());
        sb.append("]]></column-value></column>");

        sb.append("</model>");

        return sb.toString();
    }
}
